package com.cos;

import com.cos.config.thread.pool.COSTaskThreadPool;
import com.cos.utils.obj.COSObjectUpload;

import javax.swing.filechooser.FileSystemView;
import java.io.File;

/**
 * @author Irving
 * @create 2021/7/14
 * @desc
 **/
public class Main {



    public static void main(String[] args) throws InterruptedException {
        //COSObjectDownload cosObjectUtil=new COSObjectDownload();
        //cosObjectUtil.download(new StringBuffer("maosuyu"),"2021暑假百村选点汇总.xlsx",DESKTOP_PATH+"2021暑假百村选点汇总.xlsx");
        //System.out.println("继续执行");

        COSTaskThreadPool.threadPoolExecutor.execute(new Task());
        COSTaskThreadPool.threadPoolExecutor.execute(new Task());
        System.out.println(COSTaskThreadPool.threadPoolExecutor.getTaskCount());
    }

}

class Task implements Runnable {
    COSObjectUpload cosObjectUpload = new COSObjectUpload();
    private static final String DESKTOP_PATH = FileSystemView.getFileSystemView().getHomeDirectory() + File.separator;
    @Override
    public void run() {
        String filePath = DESKTOP_PATH + "华中师范大学中国农村数据库渗透测试报告-2021-07-08.docx";
        try {
            cosObjectUpload.upload(new StringBuffer("maosuyu"), filePath, null);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
